package constant.milk.cashbook.budgetstats;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import constant.milk.cashbook.R;
import constant.milk.cashbook.SuperActivity;
import constant.milk.cashbook.tip.TipInfoActivity;
import constant.milk.cashbook.tip.TipMap;

public class BudgetStatsActivity extends SuperActivity
{
	public static final String TYPE = "TYPE";
	
	public static final int OUT = 0;
	public static final int IN = 1;
	public static final int MOVE = 2;
	
	private View budgetOutView;
	private View budgetInView;
	private View budgetMoveView;
	private View statsOutView;
	private View statsInView;
	private View statsMoveView;
	
	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.budgetstats_activity);
		
		setTitle("예산통계");
		
		setFindViewId();
		setOnClick();
		setData();
	}

	@Override
	protected void setFindViewId()
	{
		budgetOutView = findViewById(R.id.budgetOutView);
		budgetInView = findViewById(R.id.budgetInView);
		budgetMoveView = findViewById(R.id.budgetMoveView);
		statsOutView = findViewById(R.id.statsOutView);
		statsInView = findViewById(R.id.statsInView);
		statsMoveView = findViewById(R.id.statsMoveView);
	}

	@Override
	protected void setOnClick()
	{
		budgetOutView.setOnClickListener(new OnClickListener()
		{
			@Override
			public void onClick(View v)
			{
				Intent intent = new Intent(superContext, BudgetActivity.class);
				intent.putExtra(TYPE, OUT);
				startActivity(intent);
			}
		});
		
		budgetInView.setOnClickListener(new OnClickListener()
		{
			@Override
			public void onClick(View v)
			{
				Intent intent = new Intent(superContext, BudgetActivity.class);
				intent.putExtra(TYPE, IN);
				startActivity(intent);
			}
		});
		
		budgetMoveView.setOnClickListener(new OnClickListener()
		{
			@Override
			public void onClick(View v)
			{
				Intent intent = new Intent(superContext, BudgetActivity.class);
				intent.putExtra(TYPE, MOVE);
				startActivity(intent);
			}
		});
		
		statsOutView.setOnClickListener(new OnClickListener()
		{
			@Override
			public void onClick(View v)
			{
				Intent intent = new Intent(superContext, StatsSearchActivity.class);
				intent.putExtra(TYPE, OUT);
				startActivity(intent);
			}
		});
		
		statsInView.setOnClickListener(new OnClickListener()
		{
			@Override
			public void onClick(View v)
			{
				Intent intent = new Intent(superContext, StatsSearchActivity.class);
				intent.putExtra(TYPE, IN);
				startActivity(intent);
			}
		});
		
		statsMoveView.setOnClickListener(new OnClickListener()
		{
			@Override
			public void onClick(View v)
			{
				Intent intent = new Intent(superContext, StatsSearchActivity.class);
				intent.putExtra(TYPE, MOVE);
				startActivity(intent);
			}
		});
	}

	@Override
	protected void setData()
	{
	}

	@Override
	protected void tipButton()
	{
		Intent intent = new Intent(superContext, TipInfoActivity.class);
		intent.putExtra(TipInfoActivity.TIP_ID, TipMap.TIP_BUDGER_STATS);
		startActivity(intent);
	}

}
